cmake_minimum_required(VERSION 3.5)

project(press_monitor VERSION 0.1 LANGUAGES CXX)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(PROJECT_SOURCES
    main.cpp
    backend_x.cpp
    backend_input.cpp
)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})


find_package(PkgConfig REQUIRED)
pkg_check_modules(LIBEVDEV REQUIRED libevdev)
include_directories(${LIBEVDEV_INCLUDE_DIRS})

find_package(X11)
find_package(Libinput)
find_package(UDev)
find_package(Threads)

find_package(Qt5 COMPONENTS Core Gui REQUIRED)

add_executable(press_monitor
            ${PROJECT_SOURCES}
        )

target_link_libraries(press_monitor PRIVATE
                      ${X11_X11_LIB}
                      ${X11_Xinput_LIB}
                      Libinput::Libinput
                      ${LIBEVDEV_LIBRARIES}
                      ${UDEV_LIBS}
                        Qt5::Core
                        ${CMAKE_THREAD_LIBS_INIT}
                      )
